home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 293_01 / t1.c < prev    next >
C/C++ Source or Header  |  1989-08-23  |  1KB  |  54 lines

  1. /*
  2.  * This programm reads in a number from the command line and uses that
  3.  * number to chose video mode. It gives the number of pixels in x and y
  4.  * before waiting for the users input, then it switches to default mode.
  5.  */
  6.  
  7.  
  8.  
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <graph.h>
  12.  
  13. main(argc, argv)
  14. int argc;
  15. char *argv[];
  16. {
  17.   int i;
  18.   char line[256];
  19.   struct videoconfig config;
  20.  
  21.   if (argc != 2) exit();
  22.   switch (**++argv) {
  23.     case '0':
  24.     default:
  25.       _setvideomode(_DEFAULTMODE);
  26.       break;
  27.     case '1':
  28.       _setvideomode(_TEXTBW40);
  29.       break;
  30.     case '2':
  31.       _setvideomode(_TEXTC40);
  32.       break;
  33.     case '3':
  34.       _setvideomode(_TEXTBW80);
  35.       break;
  36.     case '4':
  37.       _setvideomode(_TEXTC80);
  38.       break;
  39.     case '5':
  40.       _setvideomode(_MRES4COLOR);
  41.       break;
  42.     case '6':
  43.       _setvideomode(_MRESNOCOLOR);
  44.       break;
  45.     case '7':
  46.       _setvideomode(_HRESBW);
  47.       break;
  48.   }
  49.   _getvideoconfig(&config);
  50.   printf("x = %d, y = %d\n", config.numxpixels, config.numypixels);
  51.   gets(line);
  52.   _setvideomode(_DEFAULTMODE);
  53. }
  54.